<?php
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use yii\helpers\Html;
use common\components\helpers\Fun;
LayerConfirmWidget::widget();
LayerIframeWidget::widget();

?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
    <?= $this->renderFile('@app/views/layouts/toolbar.php'); ?>
    <div id="search-area" class="yx-bgf7f7f7 yx-radius5 zx-mg yx-function2 yx-pr0">
        <?= Html::beginForm(Fun::url(['couponscode/index']), 'get', ['enctype' => 'multipart/form-data']) ?>
        <?= \common\components\helpers\Search::textInput('coupons_id', null, ['label'=>'优惠券ID','class' => 'search  yx-width150 zx-lh24 yx-ml6']); ?>
        <?=\common\components\helpers\Search::dropDownList('salesman_id',null,$salesman,['label'=>'领取人','promote'=>'请选择','class'=>'search diy_select_txt'])?>
        <?=\common\components\helpers\Search::dropDownList('status',null,['null'=>'请选择','0'=>'未领取','1'=>'已领取'],['label'=>'领取状态','promote'=>'请选择','class'=>'search diy_select_txt'])?>
        <?=\common\components\helpers\Search::dropDownList('is_use',null,['null'=>'请选择','0'=>'未使用','1'=>'已使用'],['label'=>'使用状态','promote'=>'请选择','class'=>'search diy_select_txt'])?>
        <?= \common\components\helpers\Search::submitButton('搜索', ['id'=>'search-handle','class'=>"yx-search yx-radius2"]); ?>
        <?php Html::endForm() ?>
</div>
    <div class="docs-main zx-mg">
        <table id="tablesaw" class="tablesaw table yx-table1 yx-table3 table-striped with-check" data-tablesaw-mode="swipe" data-tablesaw-minimap >
            <thead>
            <tr class="yx-bgd2f6ec">
                <th><?=\Yii::t('zhtfrontend','ID');?></th>
                <th><?=\Yii::t('zhtfrontend','优惠券');?></th>
                <th><?=\Yii::t('zhtfrontend','券码');?></th>
                <th><?=\Yii::t('zhtfrontend','发券人');?></th>
                <th><?=\Yii::t('zhtfrontend','是否领取');?></th>
                <th><?=\Yii::t('zhtfrontend','是否使用');?></th>
                <th><?=\Yii::t('zhtfrontend','失效时间');?></th>
                <th><?=\Yii::t('zhtfrontend','领取时间');?></th>
            </tr>
    </thead>
            <?php if($data):?>
                <?php foreach($data as $item):?>
                    <tr data-id="<?=$item['id']?>">
                        <td><?=$item['id']?></td>
                        <td><?=$item['coupons_name']?></td>
                        <td><?=$item['code']?></td>
                        <td><?=$item['salesman_id']?></td>
                        <td><?=$item['status']?></td>
                        <td><?=$item['is_use']?></td>
                        <td><?=$item['invalid_time']?></td>
                        <td><?=$item['create_at']?></td>
                    </tr>
                <?php endforeach;?>
            <?php endif;?>
    </table>
        <div style="text-align: right"><?= common\components\widgets\GoPager::widget(['pagination' => $pages]) ?></div>
    </div>
</div>

